package org.melanesia.converters;

import java.sql.CallableStatement;

import org.melanesia.exceptions.ConversionException;


public interface JavaToJdbcConverter {
    
    /** 
     * Returns JDBC Type that should be used with converted value.
     * @see java.sql.Types 
     * @return JDBC Type
     */
    public int getJdbcType() throws ConversionException;

    /**
     * Converts value into a form that is applicable to CallableStatememt
     * @param value             value to convert
     * @param stmt              instance of CallableStatement that this value is passed to
     * @param parameterName     name of the parameter that this value is associated with
     * @return
     */
    public Object convert(Object value, CallableStatement stmt, String parameterName) throws ConversionException;
}
